<template>
    <el-table
      :data="tableData"
      style="width: 100%">
      <el-table-column
        prop="bookId"
        label="bookId"
        >
      </el-table-column>
      <el-table-column
        prop="bookName"
        label="bookName"
        >
      </el-table-column>
      <el-table-column
        prop="bookAuthor"
        label="作者">
      </el-table-column>
      
      <el-table-column
        prop="bookId"
        label="评分"
        >
            <!-- <template slot-scope="scope">
                <el-rate 
                v-model="scope.row.bookId"
                disabled
                show-score
                text-color="#ff9900"
                score-template="{value}"
                ></el-rate>
            </template> -->
        
      </el-table-column>
    </el-table>
  </template>

  <script>
    export default {
    
    // props:["tableData"],
    created:function(){
        this.$http.get("http://localhost:8888/book/init").then(
            (response)=>{
             this.tableData = response.data.data;
            console.log(this.tableData)
      }
        )
    },
      data() {
        return {
          tableData: [{
            date: '2016-05-02',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1518 弄'
          }, {
            date: '2016-05-04',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1517 弄'
          }, {
            date: '2016-05-01',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1519 弄'
          }, {
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1516 弄'
          }]
        }
      }
    }
  </script>